package com;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Phone implements Comparable<Phone>{

    private String phone;
    private Integer num;
    private Double money;


    @Override
    public String toString() {
        return "Phone{" +
                "phone='" + phone + '\'' +
                ", num=" + num +
                ", money=" + money +
                '}';
    }


    public int compareTo(Phone o) {
        return money > o.money ? -1 : 1;
    }
}
